<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Priithon.buttonbox._buttonBox</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Priithon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/priithon">Priithon</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="Priithon-module.html">Package&nbsp;Priithon</a> ::
        <a href="Priithon.buttonbox-module.html">Module&nbsp;buttonbox</a> ::
        Class&nbsp;_buttonBox
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="Priithon.buttonbox._buttonBox-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class _buttonBox</h1><p class="nomargin-top"><span class="codelink"><a href="Priithon.buttonbox-pysrc.html#_buttonBox">source&nbsp;code</a></span></p>
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Priithon.buttonbox._buttonBox-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">title</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">button box</code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">execModule</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">layout</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">boxHoriz</code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">panel</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">parent</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">pos</span>=<span class="summary-sig-default">wx.Point(-1, -1)</span>,
        <span class="summary-sig-arg">size</span>=<span class="summary-sig-default">wx.Size(-1, -1)</span>,
        <span class="summary-sig-arg">style</span>=<span class="summary-sig-default">541072960</span>)</span><br />
      if execModule is None: use __main__
       otherwise exec all string-command there</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="Priithon.buttonbox-pysrc.html#_buttonBox.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_register_onClose"></a><span class="summary-sig-name">_register_onClose</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">oC</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="Priithon.buttonbox-pysrc.html#_buttonBox._register_onClose">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="onClose"></a><span class="summary-sig-name">onClose</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">ev</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="Priithon.buttonbox-pysrc.html#_buttonBox.onClose">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="startNewRow"></a><span class="summary-sig-name">startNewRow</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">weight</span>=<span class="summary-sig-default">1</span>,
        <span class="summary-sig-arg">expand</span>=<span class="summary-sig-default">True</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="Priithon.buttonbox-pysrc.html#_buttonBox.startNewRow">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Priithon.buttonbox._buttonBox-class.html#addButton" class="summary-sig-name">addButton</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">label</span>,
        <span class="summary-sig-arg">cmd</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">refitFrame</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">weight</span>=<span class="summary-sig-default">1</span>,
        <span class="summary-sig-arg">expand</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">tooltip</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">iniFcn</span>=<span class="summary-sig-default">None</span>)</span><br />
      if label is of form &quot;X\t...&quot;:
   if X is 'b'  a button will be created (that's also the default)
       cmd will be executed on button-press
       if cmd is None:
           cmd = label</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="Priithon.buttonbox-pysrc.html#_buttonBox.addButton">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">title</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">button box</code><code class="variable-quote">'</code></span>,
        <span class="sig-arg">execModule</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">layout</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">boxHoriz</code><code class="variable-quote">'</code></span>,
        <span class="sig-arg">panel</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">parent</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">pos</span>=<span class="sig-default">wx.Point(-1, -1)</span>,
        <span class="sig-arg">size</span>=<span class="sig-default">wx.Size(-1, -1)</span>,
        <span class="sig-arg">style</span>=<span class="sig-default">541072960</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="Priithon.buttonbox-pysrc.html#_buttonBox.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

if execModule is None: use __main__
       otherwise exec all string-command there

layout:
  boxHoriz OR h   - horizontal BoxSizer, use &quot;\n&quot; to start new row
  boxVert  OR v   - vertical   BoxSizer, use &quot;\n&quot; to start new column
  (rows,cols)           - FlexGridSizer (one of nx or ny can be 0)
  (rows,cols,vgap,hgap) - FlexGridSizer (one of nx or ny can be 0)

panel: put buttons into this panel
  - if None: 
     create new frame
     use title, parent, pos and style for that frame

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="addButton"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">addButton</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">label</span>,
        <span class="sig-arg">cmd</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">refitFrame</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">weight</span>=<span class="sig-default">1</span>,
        <span class="sig-arg">expand</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">tooltip</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">iniFcn</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="Priithon.buttonbox-pysrc.html#_buttonBox.addButton">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

if label is of form &quot;X\t...&quot;:
   if X is 'b'  a button will be created (that's also the default)
       cmd will be executed on button-press
       if cmd is None:
           cmd = label

   if X is 'tb'  a toggle-button will be created
       cmd will be executed on button-press
          (variable 'x' will contain the button status)
       if cmd is None:
           cmd = label

   if X is 't'  a TextCtrl field will be created
       cmd will be executed on EVERY text change
          (variable 'x' will contain the text as string)
       unless if cmd[:2] == '--':
           this means: text field is NOT editable
       ...-part of label is the default value put in the text-field 
       #todo if ...-part of label is of form '...       ...':
       #todo    the first part will be used as a &quot;label&quot; for the text field
       #todo    the second part will be the default text
       
   if X is 'c'  a CheckBox field will be created
       cmd will be executed on on click
          (variable 'x' will contain True/False [isChecked])
       ...-part of label is a text label
             'CheckBox' will be left-of 'text label'
                 except if ...-part contains '  ', then
             'CheckBox' will be right-of 'text label'
   if X is 'r'  a RadioButton field will be created
       &lt;...&gt;
   if X is 'l'  a StaticText label will be created
       label will be aligned to 'right'
       cmd will never be executed

    if X contains a ' ' the part after ' ' will be executed with 'x' being the control-object
       use this to keep a reference to the respective wxControl
       example: &quot;b myButton=x&quot;
       
if weight is 0 button gets set to minimum size (horizontally)
   otherwise size gets distributed between all buttons
if expand is True button expands in vertical direction with buttonBox
if tooltip is None:
   set tooltip to be the cmd-string, or another expaining string
else: 
   set tooltip as given
iniFcn (string): exec like the ' '-syntax in label
       (callable): call with (execModule, button) as arguments

NOTE:
    all execs are done in a given `execModule` as globals()
    to modify the module&quot;s namespace the module is accessible as '_'
       e.g.: _.x = x
             _.myTextControl = x
    (in cmd for buttons there is no 'g' - just use names directly instead: e.g. x = 5)
    `cmd` (`command`) will get exec'ed when the button is pressed, or the text is changed
      if will get exec'ed with globals been the buttonbox's execModule
                           and locals as follows:
       `x`: the control's value
       `_`: the execModule  -- so that you can write &quot;_.x = x&quot;, instead of &quot;globals()[x] = x&quot;
       `_ev`: the wx-event (wxButtonEvent, ....)
       `_b`: the wxControl (the buttonbox's &quot;button&quot;, or now more general, it's &quot;gui-control&quot;) object
                ( same as _ev.GetEventObject() )
      OR if cmd is a callable: cmd(execModule, ButtonValue, buttonObj, WxEvt) is called

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Priithon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/priithon">Priithon</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Nov 22 14:59:34 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
